﻿Public Class EstudianteNegocio
    Function insertarEstudiante(ByVal a As Integer, ByVal b As String, ByVal c As String, ByVal d As String, ByVal e As Integer, ByVal f As String, ByVal g As Integer, ByVal h As String, ByVal i As String, ByVal j As Integer, ByVal k As String)

        Dim modelo As New Estudiante()
        modelo.idCentroEstudio = a
        modelo.Nombres = b
        modelo.ApellidoP = c
        modelo.ApellidoM = d
        modelo.Edad = e
        modelo.Direccion = f
        modelo.Telefono = g
        modelo.Correo = h
        modelo.EstadoCiv = i
        modelo.DNI = j
        modelo.Clave = k

        Dim dao As New EstudianteDAO
        Try
            Return dao.insertar(modelo)
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Sub actualizar(ByVal idEstudiante As Integer, ByVal a As Integer, ByVal b As String, ByVal c As String, ByVal d As String, ByVal e As Integer, ByVal f As String, ByVal g As Integer, ByVal h As String, ByVal i As String, ByVal j As Integer, ByVal k As String)


        Dim modelo As New Estudiante()

        modelo.idEstudiante = idEstudiante
        modelo.idCentroEstudio = a
        modelo.Nombres = b
        modelo.ApellidoP = c
        modelo.ApellidoM = d
        modelo.Edad = e
        modelo.Direccion = f
        modelo.Telefono = g
        modelo.Correo = h
        modelo.EstadoCiv = i
        modelo.DNI = j
        modelo.Clave = k


        Dim dao As New EstudianteDAO
        dao.actualizar(modelo)
    End Sub

    Public Function obtener(ByVal idEstudiante As Integer) As Estudiante
        Dim dao As New EstudianteDAO
        Return dao.obtener(idEstudiante)
    End Function

    Public Function listar() As Collection
        Dim dao As New EstudianteDAO
        Return dao.listar()
    End Function


    Public Function buscarPorNombre(ByVal Nombres As String) As Collection
        Dim dao As New EstudianteDAO
        Return dao.buscarPorNombre(Nombres)
    End Function


    'Public Function validar(ByVal correo As String, ByVal clave As String) As Estudiante
    '    Dim modelo As New Estudiante
    '    modelo.Correo = correo
    '    modelo.Clave = clave

    '    Dim dao As New EstudianteDAO
    '    Return dao.validar(modelo)
    'End Function


End Class
